﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!--自适应界面,如果出现,在某些设备出现界面偏小的话,检查一下有没有加入这句 -->
    <meta http-equiv="Content-type" name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">

    <link rel="stylesheet" href="../../js/jqmobile/jquery.mobile-1.4.5.min.css" />

    <script src="../../js/jquery.min2.1.4.js"></script>
    <script src="../../js/jqmobile/jquery.mobile-1.4.5.min.js"></script>
    <script src="../../js/cordova-1.5.0.js"></script>
    <script src="../../js/jshelp.js"></script>
    <style type="text/css">
        #controlgroupid .ui-controlgroup-controls {
            width: 100%;
        }

        #controlgroupid a {
            width: 25%;
            box-sizing: border-box;
        }
    </style>
    <script>
        //接受传参
        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null) return unescape(decodeURI(r[2])); return null; //返回参数值
        }
        var mobile = getUrlParam('mobile');
        var customerCode = getUrlParam('customerCode');
        function tz(lx) {
            if (lx == "主页") {
                location.href = "main.html?mobile=" + mobile + "&customerCode=" + customerCode;
            }
            else if (lx == "申请") {
                location.href = "TransferRequest\\sq_list.html?mobile=" + mobile + "&customerCode=" + customerCode;
            }
            else if (lx == "抢单") {
                location.href = "TransferSnatch\\list.html?mobile=" + mobile + "&customerCode=" + customerCode;
            }
            else if (lx == "发货") {
                location.href = "TransferDeliver\\list.html?mobile=" + mobile + "&customerCode=" + customerCode;
            }
            else if (lx == "配置") {
                location.href = "Config\\list.html?mobile=" + mobile + "&customerCode=" + customerCode;
            }
        }
        //getuser();
        function getuser() {
            debugger
            $.ajax({
                type: "get",
                async: false,            //异步请求（同步请求将会锁住浏览器，用户其他操作必须等待请求完成才可以执行）
                url: "http://oa.satchi.com.cn/fuli/getSysInforForCurrentUser.jsp?t=" + new Date().getTime(),
                contentType: "application/x-www-form-urlencoded",
                //contentType: "application/json",
                data: {  },
                dataType: "JSONP",        //返回数据形式为json
                success: function (data) {
                    debugger
                    if (data.Message == "True") {
                        var abc = data.UserID;
                        //提示
                        layer.open({
                            content: "抢单成功，请尽快发货并到调拨发货中填写快递单号等信息!"
                            , skin: 'msg'
                            , time: 3 //5秒后自动关闭
                            , end: function (index) {
                                layer.close(index);
                                location.reload();
                            }
                        });


                    } else {
                        //询问框
                        //提示
                        layer.open({
                            content: data.remsg
                            , skin: 'msg'
                            , time: 2 //2秒后自动关闭
                        });
                    }
                }
            });
        }
        function getCurrentUserInfor() {
            var dataMap = {};
            jQuery.ajax({
                url: "http://oa.satchi.com.cn/fuli/getSysInforForCurrentUser.jsp?t=" + new Date().getTime(),
                data: "",
                async: false,
                dataType: "json",
                contentType: "application/json",
                success: function (data) {
                    debugger
                    dataMap = data; //Message,SubCompanyID,DepartmentID,UserName,Loginid,UserID,UserType,Language
                }
            });
            return dataMap;
        }

        //var userInfor = getCurrentUserInfor();  // 调用js方法
        //var currentUserID = userInfor.UserID;   // 获取用户ID
    </script>
</head>
<body>
    <div data-role="header" data-position="fixed">
        <h1>首页</h1>
    </div>
    <div data-role="content" id="main1Content">
        <p id="p_sale" style="text-align:center"></p>
        <p id="p_buy" style="text-align:center"></p>
        <div class="ui-grid-b">
            <div class="ui-block-a" onclick="tz('申请')"><img src="../../images/dbsq_icon.png" width="80%" /></div>
            <div class="ui-block-b" onclick="tz('抢单')"><img src="../../images/dbqd_icon.png" width="80%" /></div>
            <div class="ui-block-c" onclick="tz('发货')"><img src="../../images/dbfh_icon.png" width="80%" /></div>
        </div>
        <!--<div class="ui-grid-b">
            <div class="ui-block-a" onclick="tz('生日赠品')"><img src="../../images/srzp_icon.png" width="80%" /></div>
            <div class="ui-block-b" onclick="tz('申请列表')"><img src="../../images/sqlist_icon.png" width="80%" /></div>
        </div>-->
    </div>
    <div data-role="footer" data-position="fixed">
        <div data-role="navbar">
            <ul id="navbarlist">
                <li><a href="#" onclick="tz('主页')" data-role="button" data-icon="home" data-iconpos="top">首页</a></li>
                <li><a href="#" onclick="tz('申请')" data-role="button" data-icon="plus" data-iconpos="top">调拨申请</a></li>
                <li><a href="#" onclick="tz('抢单')" data-role="button" data-icon="shop" data-iconpos="top">调拨抢单</a></li>
                <li><a href="#" onclick="tz('发货')" data-role="button" data-icon="navigation" data-iconpos="top">调拨发货</a></li>
                <li><a href="#" onclick="tz('配置')" data-role="button" data-icon="gear" data-iconpos="top">设置</a></li>
            </ul>
        </div>
    </div>
</body>
</html>
